﻿using System;
using XStudio.XCRF.Data.Enums;

namespace XStudio.XCRF.Data.Business.Permissions
{
    /// <summary>
    /// 表示允许指定类型的用户操作
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
    public class AllowMemberTypeAttribute : BasePermissionAttribute
    {
        /// <summary>
        /// 表示允许指定类型的用户操作
        /// </summary>
        /// <param name="types">允许操作的用户类型，可以采用按位或表示多种</param>
        public AllowMemberTypeAttribute(MemberTypes types)
        {
            _AllowedTypes = types;
        }

        /// <summary>
        /// 被允许的用户类型
        /// </summary>
        private MemberTypes _AllowedTypes;
        /// <summary>
        /// 获取被允许的用户类型
        /// </summary>
        public MemberTypes AllowedTypes { get { return _AllowedTypes; } }
    }
}
